// +----------------------------------------------------------------------
// | BossHongshi [鸿时互娱管理系统]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://www.hongshihuyu.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: wgh
// +----------------------------------------------------------------------

const fly=require("flyio");
const HashMap = require('hashmap');
var urlencode = require('urlencode');
module.exports = class extends think.cmswing.admin {
  /**
     * index action
     * @return {Promise} []
     */
  constructor(ctx) {
    super(ctx); // 调用父级的 constructor 方法，并把 ctx 传递进去
    // 其他额外的操作
  }

  /**
     * 好友房-斗牛
     * @returns {*}
     */
  async frienddouniuAction() {
    let startdate = this.get('startdate');
    let enddate = this.get('enddate');
    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=4000&begintime='+startdate+'&endtime='+enddate+'&sign=password';
    console.log('frienddouniu url------------------:'+url);
	  
	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    //6人10局 6人20局 6人30局 9人10局 9人20局 9人30局
    let legendList = ['6人10局','6人20局','6人30局','9人10局','9人20局','9人30局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
        
        //seriesList[seriesList.length] = JSON.stringify(series);
    } 
    console.log("frienddouniu seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('period', period);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '斗牛统计';
    return this.display();
  }


    /**
     * 好友房-炸金花
     * @returns {*}
     */
  async friendzhajinhuaAction() {
	let startdate = this.get('startdate');
    let enddate = this.get('enddate');

    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	this.assign('period', period);
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=207&begintime='+startdate+'&endtime='+enddate+'&sign=password';
	console.log('friendzhajinhua url------------------:'+url);

	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    let legendList = ['5人8局','5人16局','9人8局','9人16局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
    } 

    console.log("friendzhajinhua seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '炸金花统计';
    return this.display();
  }


    /**
     * 好友房-跑得快
     * @returns {*}
     */
  async friendpaodekuaiAction() {
	let startdate = this.get('startdate');
    let enddate = this.get('enddate');

    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	this.assign('period', period);
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=200&begintime='+startdate+'&endtime='+enddate+'&sign=password';
	console.log('friendpaodekuai url------------------:'+url);

	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    let legendList = ['2人8局','2人16局','3人8局','3人16局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
    } 
    console.log("friendpaodekuai seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '跑得快统计';
    return this.display();
  }

    /**
     * 金币场-斗牛
     * @returns {*}
     */
  async coindouniuAction() {
    let startdate = this.get('startdate');
    let enddate = this.get('enddate');
    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=4000&begintime='+startdate+'&endtime='+enddate+'&sign=password';
    console.log('coindouniu url------------------:'+url);
	  
	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    //6人10局 6人20局 6人30局 9人10局 9人20局 9人30局
    let legendList = ['6人10局','6人20局','6人30局','9人10局','9人20局','9人30局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
        
        //seriesList[seriesList.length] = JSON.stringify(series);
    } 

    console.log("coindouniu seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('period', period);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '斗牛统计';
    return this.display();
  }


    /**
     * 金币场-炸金花
     * @returns {*}
     */
  async coinzhajinhuaAction() {
	let startdate = this.get('startdate');
    let enddate = this.get('enddate');

    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	this.assign('period', period);
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=207&begintime='+startdate+'&endtime='+enddate+'&sign=password';
	console.log('coinzhajinhua url------------------:'+url);

	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    let legendList = ['5人8局','5人16局','9人8局','9人16局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
    } 

    console.log("coinzhajinhua seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '炸金花统计';
    return this.display();
  }


    /**
     * 金币场-跑得快
     * @returns {*}
     */
  async coinpaodekuaiAction() {
	let startdate = this.get('startdate');
    let enddate = this.get('enddate');

    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	this.assign('period', period);
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=200&begintime='+startdate+'&endtime='+enddate+'&sign=password';
	console.log('coinpaodekuai url------------------:'+url);

	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    let legendList = ['2人8局','2人16局','3人8局','3人16局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
    } 
    console.log("coinpaodekuai seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '跑得快统计';
    return this.display();
  }

    /**
     * 俱乐部-斗牛
     * @returns {*}
     */
  async clubdouniuAction() {
    let startdate = this.get('startdate');
    let enddate = this.get('enddate');
    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=4000&club_id=-1&begintime='+startdate+'&endtime='+enddate+'&sign=password';
    console.log('clubdouniu url------------------:'+url);
	  
	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    //6人10局 6人20局 6人30局 9人10局 9人20局 9人30局
    let legendList = ['6人10局','6人20局','6人30局','9人10局','9人20局','9人30局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
        
        //seriesList[seriesList.length] = JSON.stringify(series);
    } 
    console.log("clubdouniu seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('period', period);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '斗牛统计';
    return this.display();
  }


    /**
     * 俱乐部-炸金花
     * @returns {*}
     */
  async clubzhajinhuaAction() {
	let startdate = this.get('startdate');
    let enddate = this.get('enddate');

    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	this.assign('period', period);
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=207&club_id=-1&begintime='+startdate+'&endtime='+enddate+'&sign=password';
	console.log('clubzhajinhua url------------------:'+url);

	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    let legendList = ['5人8局','5人16局','9人8局','9人16局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
    } 

    console.log("clubzhajinhua seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '炸金花统计';
    return this.display();
  }


    /**
     * 俱乐部-跑得快
     * @returns {*}
     */
  async clubpaodekuaiAction() {
	let startdate = this.get('startdate');
    let enddate = this.get('enddate');

    const period = this.get('period');
    
    if(!think.isEmpty(period)) {
      if(period == 1){
        startdate = GetDateStr(-30);
        enddate =  GetDateStr(0);
      }else if(period == 2){
        startdate = GetDateStr(-90);
        enddate =  GetDateStr(0);
      }else if(period == 3){
        startdate = GetDateStr(-365);
        enddate =  GetDateStr(0);
      }
    }
	this.assign('period', period);
	
    if(think.isEmpty(startdate)) {
        startdate = GetDateStr(-7);
    }
    if(think.isEmpty(enddate)) {
        enddate =  GetDateStr(0);
    }

    const url = 'http://www.hongshihuyu.com:8092/GameStaticRecord?map_id=200&club_id=-1&begintime='+startdate+'&endtime='+enddate+'&sign=password';
	console.log('clubpaodekuai url------------------:'+url);

	fly.config.timeout=10000;
	fly.config.parseJson=true;
	fly.interceptors.response.use(
			    (response) => {
			        //只将请求结果的data字段返回
			        return response.data
			    },
			    (err) => {
			        //发生网络错误后会走到这里
			        //return Promise.resolve("ssss")
			    }
	);
    let ret = await fly.get(url).catch(() => false);
    //console.log('ret------------------:'+ret);
	let dataList = (ret === false?null:JSON.parse(ret));
    //console.log("frienddouniu dataList --:"+JSON.stringify(dataList));
    
    let legendList = ['2人8局','2人16局','3人8局','3人16局'];
    //let seriesList  = new Array();// 数组
    let seriesList  = [];// 数组
    // xAxisdataList ['2019-04-01','2019-04-02','2019-04-03','2019-04-04','2019-04-05','2019-04-06','2019-04-07'];
    let xAxisdataList = getDateList(startdate,enddate);
    //console.log("frienddouniu xAxisdataList --1:"+JSON.stringify(xAxisdataList));

    for (const legend of legendList) {
        let series = {}; 
        series.name=legend;
        series.type='line';
        series.smooth= true;
        series.data=[];
        for (const xAxisdata of xAxisdataList) {
          var onpush = false;
          for (const data of dataList) {
            if(xAxisdata == data._id.ctime){
               var datalegend = data._id.player_count+'人'+data._id.total_round+'局';
               if(legend == datalegend){
                   series.data.push(data.count);
                   onpush = true;
                   break;
               }
            }
          }
          if(!onpush){
             series.data.push(0);
          }
        }
        seriesList[seriesList.length] = series;
    } 
    console.log("clubpaodekuai seriesList --:"+JSON.stringify(seriesList));

    this.assign('startdate', startdate);
    this.assign('enddate', enddate);
    this.assign('legendList', legendList);
    this.assign('xAxisdataList', xAxisdataList);
    this.assign('seriesList', seriesList);

    this.meta_title = '跑得快统计';
    return this.display();
  }

};
